package cn.funnyxb.powerremember.uis.wordbases;

import android.app.Activity;
import android.app.AlertDialog;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.database.Cursor;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import cn.funnyxb.powerremember.beans.WordBase;
import cn.funnyxb.tools.appFrame.App;
import cn.funnyxb.tools.appFrame.activityFrame.ActivitysHolder;
import cn.funnyxb.tools.appFrame.debugTool.Debuger;
import com.mobclick.android.MobclickAgent;

public class BrowWordBasesActivity extends Activity
  implements IUI_BrowWordBases
{
  private View.OnClickListener btnOnclickListener = new 1(this);
  private IProccessor_BrowWordBases proccessor;
  private ProgressDialog progressDialog;
  private SimpleCursorAdapter sca = null;

  private void createSCA(Cursor paramCursor)
  {
    String[] arrayOfString = new String[1];
    arrayOfString[0] = "name";
    int[] arrayOfInt = new int[1];
    arrayOfInt[0] = 16908308;
    this.sca = new SimpleCursorAdapter(this, 17367043, paramCursor, arrayOfString, arrayOfInt);
    ((ListView)findViewById(2131165187)).setAdapter(this.sca);
    ((ListView)findViewById(2131165187)).setOnItemClickListener(new 2(this));
  }

  private void initFrame()
  {
    setTitle(getTitle() + "-->" + getString(2131034196));
    findViewById(2131165187).setBackgroundResource(17301654);
    findViewById(2131165185).setOnClickListener(this.btnOnclickListener);
    findViewById(2131165186).setOnClickListener(this.btnOnclickListener);
  }

  private void log(String paramString)
  {
    Debuger.log("browWordBase", paramString);
  }

  public void dismissWaitingDialog()
  {
    if (this.progressDialog == null)
      return;
    this.progressDialog.dismiss();
  }

  public void notifyTasksDataLoaded(Cursor paramCursor)
  {
    if ((isFinishing()) || (isRestricted()));
    while (true)
    {
      return;
      log("cursor_wordbases cnt=" + paramCursor.getCount() + "  cursor=" + paramCursor);
      dismissWaitingDialog();
      if (this.sca == null)
      {
        createSCA(paramCursor);
        ((ListView)findViewById(2131165187)).setAdapter(this.sca);
      }
      this.sca.changeCursor(paramCursor);
    }
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    this.proccessor = new Proccessor_BrowWordBases(this);
    setContentView(2130903058);
    initFrame();
  }

  protected void onDestroy()
  {
    try
    {
      this.sca.getCursor().close();
      this.proccessor.destroy();
      super.onDestroy();
      return;
    }
    catch (Exception localException)
    {
    }
  }

  protected void onPause()
  {
    super.onPause();
    MobclickAgent.onPause(this);
    log("onPause");
  }

  protected void onRestart()
  {
    super.onRestart();
    log("onReStart");
  }

  protected void onResume()
  {
    super.onResume();
    log("onResume");
    MobclickAgent.onResume(this);
    App.getApp().getActivitysHolder().regCurrentActivity(this);
  }

  protected void onStart()
  {
    super.onStart();
    log("onStart");
    this.proccessor.asyncLoadData();
  }

  protected void onStop()
  {
    super.onStop();
    log("onStop");
  }

  public void showWaitingDialog(String paramString1, String paramString2)
  {
    if (this.progressDialog == null)
      this.progressDialog = new ProgressDialog(this);
    if (paramString1 != null)
      this.progressDialog.setTitle(paramString1);
    if (paramString2 != null)
      this.progressDialog.setMessage(paramString2);
    this.progressDialog.setCancelable(false);
    this.progressDialog.show();
  }

  protected void showWordBaseInfo(WordBase paramWordBase)
  {
    if (paramWordBase == null)
      label4: return;
    String str1 = paramWordBase.getName();
    String str2 = paramWordBase.getTbExtName();
    boolean bool = paramWordBase.getTbExtName().contains("self");
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this).setTitle(2131034197);
    if (bool);
    for (String str3 = getString(2131034203); ; str3 = getString(2131034202))
    {
      localBuilder.setMessage(getString(2131034198) + "：" + str1 + "\n" + getString(2131034201) + "：" + str3 + "\n" + getString(2131034200) + "：" + paramWordBase.getWordsCnt());
      localBuilder.setNegativeButton(2131034134, null);
      if (bool)
        localBuilder.setPositiveButton(getString(2131034199), new 3(this, str1, str2));
      localBuilder.create().show();
      break label4:
    }
  }
}

/* Location:           E:\Desktop\复件 classes_dex2jar.jar
 * Qualified Name:     cn.funnyxb.powerremember.uis.wordbases.BrowWordBasesActivity
 * JD-Core Version:    0.5.3
 */